package com.kitbox.hl.meshow.web;

import com.kitbox.hl.meshow.service.ICamundaHookService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Auther: honglei
 * @Date: 2019/9/4 11:43
 * @Description:
 */
@Api
@RestController
@RequestMapping("/pr")
public class CamundaHookController implements ICamundaHookService {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private  ICamundaHookService camundaHookService;

    @Override
    public int reportUrl(String processDefinitionId, String url, String processInstanceId, int type) {
        return camundaHookService.reportUrl(processDefinitionId,url,processInstanceId,type);
    }




    @ApiOperation(value = "回调url测试")
    @RequestMapping(value = "/callbak",method = {RequestMethod.POST,RequestMethod.GET})
    public Object callbak( String json,Map map) {
        logger.info("事件回调返回事件：");
        logger.info(json);
        return json;
    }
}
